import {Base} from '../../utils/base.js'
class Home extends Base{
   constructor(){
      super();
   }
   //获取banner的数据
   getBannerData(id, callback){
     var params = {
        url: 'banner/' + id,
        scallback: function(res){
           callback&&callback(res.item);
        }
     }
     this.request(params);
   }
   //获取theme的数据
   getThemeData(callback){
      var params = {
         url:'theme?id=1,2,3',
         scallback:function(res){
            callback&&callback(res);
         }
      }  
      this.request(params);
   }
   // 获取最新新品
   getProductsData(callback){
      var params = {
         url:'product/recent',
         scallback:function(res){
            callback&&callback(res);
         }
      }
      this.request(params);
   }
   // 获取点击事件中的data-xxx的数据
   getDataSet(event,key){
      return event.currentTarget.dataset[key];
   }
}
export {Home}